home *** CD-ROM | disk | FTP | other *** search
- /*_ io.h Sat Aug 19 1989 Modified by: Walter Bright */
- /* Copyright (C) 1987-1990 by Walter Bright */
- /* All Rights Reserved */
- /* Written by Walter Bright */
- /* $Revision: 1.3 $ */
-
- /* Declarations for low level I/O functions */
-
- #ifndef __IO_H
- #define __IO_H 1
-
- #if __cplusplus
- extern "C" {
- #endif
-
- #ifdef __STDC__
- #define __CDECL
- #define __STDCALL
- #else
- #define __CDECL __cdecl
- #define __STDCALL __stdcall
- #endif
-
- #if __OS2__ && __INTSIZE == 4
- #define __CLIB __STDCALL
- #else
- #define __CLIB __CDECL
- #endif
-
- int __CLIB read(int,void *,unsigned);
- int __CLIB write(int,const void *,unsigned);
- #define _read read
- #define _write write
-
- #if __INTSIZE == 2
- int __CLIB _readx(int,void *,unsigned,unsigned);
- int __CLIB _writex(int,void *,unsigned,unsigned);
- #endif
-
- #if M_UNIX || M_XENIX
- char __CLIB *ttyname(int filedes);
- int __CLIB rdchk(int filedes);
- int __CLIB fcntl(int filedes, int cmd, int arg);
- int __CDECL ioctl(int filedes, int cmd,...);
- int __CDECL umask(int mask);
- long __CDECL ulimit(int,long);
- #else
- int __CDECL dos_open(const char *,int,...);
- int __CDECL sopen(const char *, int, int, ...);
- int __CLIB setmode(int,int);
- #define _setmode setmode
- #define _sopen sopen
- #endif
-
- struct ftime
- {
- unsigned ft_tsec : 5;
- unsigned ft_min : 6;
- unsigned ft_hour : 5;
- unsigned ft_day : 5;
- unsigned ft_month : 4;
- unsigned ft_year : 7;
- };
-
- int __CLIB getftime(int FHdl, struct ftime *FtPtr);
- int __CLIB setftime(int handle, struct ftime *ptr);
- int __CLIB lock(int FHdl, long Offset, long Size);
- int __CLIB unlock(int handle, long offset, long length);
-
-
- int __CDECL creatnew(const char *, int);
- int __CDECL creattemp(char *, int);
- int __CDECL open(const char *,int,...);
- int __CLIB creat(const char *,int);
- int __CLIB close(int);
- int __CLIB locking(int, int, long);
- int __CLIB _commit(int);
- int __CLIB eof(int handle);
- #define _open open
- #define _close close
- #define _creat creat
- #define _locking locking
- #define _eof eof
-
- int __CLIB unlink(const char *);
- #define _unlink unlink
-
- int __CLIB remove(const char *);
- int __CLIB chsize(int, long);
- #define _chsize chsize
- #define tell( handle ) _lseek( handle, 0L, SEEK_CUR )
- #define _tell tell
-
- int __CLIB chmod(const char *,int);
- #define _chmod chmod
-
- int __CLIB dup(int);
- int __CLIB dup2(int, int);
- char * __CLIB mktemp(char *);
- #define _mktemp mktemp
- #define _dup dup
- #define _dup2 dup2
-
- int __CLIB access(const char *,int);
- #define _access access
-
- #define F_OK 0 /* does file exist? */
- #define X_OK 1 /* execute permission? */
- #define W_OK 2 /* write permission? */
- #define R_OK 4 /* read permission? */
-
- long __CLIB lseek(int,long,int);
- #define _lseek lseek
- #define SEEK_SET 0 /* seek from start of file */
- #define SEEK_CUR 1 /* relative to current position */
- #define SEEK_END 2 /* relative to end of file */
-
- long __CLIB filesize(const char *);
- long __CLIB filelength(int);
- int __CLIB isatty(int);
- #define _filelength filelength
- #define _isatty isatty
-
- unsigned short __CLIB getDS(void);
-
- #ifndef __STDC__
- #define getDS() ((unsigned short)__emit__(0x8C,0xD8))
- #endif
-
- #if __cplusplus
- }
- #endif
-
- #endif /* __IO_H */
-
-